function alert(title,back)
{
    wx.showModal({
        title: '提示',
        content: title,
        showCancel:false,
        success:function () {
            back&&back();
        }
    })
}
function confirm(title,back_success,back_error)
{
    wx.showModal({
        title: '提示',
        content: title,
        success:function (res){
            if (res.confirm) {
                back_success&&back_success();
            } else if (res.cancel) {
                back_error&&back_error();
            }
        }
    })
}
function msg(title,icon)
{
    icon=icon?icon:"none";
    wx.showToast({
        title:title,
        icon: icon,
        mask: true,
        duration: 2000
    })
}
function loadding(title){
    wx.showLoading({
        title: title,
        mask:true
    });
}
function hideLoading(){
    wx.hideLoading();
}
module.exports = {
    alert: alert,
    msg: msg,
    confirm: confirm,
    loadding:loadding,
    hideLoading:hideLoading
}